<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
	<title>电影管理系统</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Amaze UI Admin index Examples</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="icon" type="image/png" href="../assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="../assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
    <link rel="stylesheet" href="../assets/css/amazeui.min.css"/>
    <link rel="stylesheet" href="../assets/css/admin.css">
</head>
<body>
   <div class="admin-index">
             <!--    <dl data-am-scrollspy="{animation: 'slide-right', delay: 100}">
                    <dt class="qs"><i class="am-icon-users"></i></dt>
                    <dd>455</dd>
                    <dd class="f12">会员数量</dd>
                </dl> -->
                <dl data-am-scrollspy="{animation: 'slide-right', delay: 300}">
                    <dt class="cs"><i class="am-icon-area-chart"></i></dt>
                    <dd id="todayCount"></dd>
                    <dd class="f12">今日购票数量</dd>
                </dl>
                <dl data-am-scrollspy="{animation: 'slide-right', delay: 600}">
                    <dt class="hs"><i class="am-icon-shopping-cart"></i></dt>
                    <dd id="todaySum"></dd>
                    <dd class="f12">今日收入</dd>
                </dl>
             <!--    <dl data-am-scrollspy="{animation: 'slide-right', delay: 900}">
                    <dt class="ls"><i class="am-icon-cny"></i></dt>
                    <dd>455</dd>
                    <dd class="f12">全部收入</dd>
                </dl> -->
            </div>
          <!--   <div class="admin-biaoge">
                <div class="xinxitj">信息概况</div>
                <table class="am-table">
                    <thead>
                    <tr>
                        <th>全部用户</th>
                        <th>今日新增</th>
                        <th>本月新增</th>
                        <th>会员总数</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td>普通用户</td>
                        <td>+20</td>
                        <td>+150</td>
                        <td> 4534</td>
                    </tr>
                    <tr>
                        <td>银卡</td>
                        <td>+20</td>
                        <td>+150</td>
                        <td> 4534</td>
                    </tr>
                    <tr>
                        <td>金卡</td>
                        <td>+20</td>
                        <td>+150</td>
                        <td> 4534</td>
                    </tr>
                    <tr>
                        <td>钻卡</td>
                        <td>+20</td>
                        <td>+150</td>
                        <td> 4534</td>
                    </tr>
                    <tr>

                        <td>合计</td>
                        <td>80</td>
                        <td>+50</td>
                        <td> 4534</td>
                    </tr>
                    </tbody>
                </table>

            </div> -->
            
       <!--      <div class="admin-biaoge">
             	<div class="xinxitj">验证兑换码</div>
             	
             	<form id="orderCode_from">
             		请输入兑换码   <input id="orderCode" name="orderCode" /> <button type="reset" value="重置" >重置</button> <button id="orderCode_bt" type="button" value="提交" >提交 </button>
					
             	</form>
 				
            </div> -->
           
            
            <div >
            	 <table id="orderCode_tb" width="100%" class="am-table am-table-bordered am-table-radius am-table-striped am-table-hover">
                    <thead>
                   <tr class="am-success">
                    	<th width="90px" class="table-set">订单编号</th>
                        <th class="table-title">电影名称</th>
                        <th  class="table-type">影厅</th>
                        <th  class="table-author am-hide-sm-only">座位</th>
                        <th  class="table-author am-hide-sm-only">购票数量</th>
                        <th class="table-author am-hide-sm-only">购票价格</th>
                        <th class="table-date am-hide-sm-only">购票日期</th>
                        <th  class="table-author am-hide-sm-only">购票用户</th>
                        <th width="80px" class="table-set">操作</th>
                    </tr>
                    </thead>
                    <tbody id="orderCode_List">
                    	
                    </tbody>
                    
                </table>
            
            </div>
        <!--     <div class="foods">
                <ul>
                   	 版权所有@2018. @author Avengers
                </ul>
                <dl><a href="" title="返回头部" class="am-icon-btn am-icon-arrow-up"></a></dl>
            </div> -->
        </div>
    <script id="template_order" type="text/html">
			<tr>	
 				   <td id="orderId"> {{d.id }} </td>
                   <td id="movieName"> {{d.schedule.movieName }} </td>
				   <td id="description"> {{d.schedule.description }} </td>
				   <td id="seats"> {{# for(var i=0;i<d.seatList.length;i++){ }} 
											<span>{{ d.seatList[i].row }}排{{ d.seatList[i].line }}座</span>

									{{# } }}
						</td>
                   <td id="movieCount"> {{d.count }} </td>
                   <td id="adjustedPrice" class="am-hide-sm-only">{{d.adjustedPrice}}</td>
                   <td id="buyDate" class="am-hide-sm-only">{{d.buyDate}}</td>
                   <td id="userName" class="am-hide-sm-only"> {{d.userName}}</td>
				   <td id="print" class="am-hide-sm-only"> <a href="javascript:void(0)">打印</a></td>
             </tr>

	</script>

 	<script src="../assets/js/amazeui.min.js"></script>
 	<script type="text/javascript">
	$(function(){
		
		getTodayOrderCount();
	});
		
		
		
		
		//获取当天订单总数
		function getTodayOrderCount(){
			 var now = new Date();
	        var year = now.getFullYear();
	        var month =(now.getMonth() + 1).toString();
	        var day = (now.getDate()).toString();
	        if (month.length == 1) {
	            month = "0" + month;
	        }
	        if (day.length == 1) {
	            day = "0" + day;
	        }
	        var date = year +"-"+ month +"-"+  day;   

			$.ajax({
				url:"/moviesMaven/order/getOrderCount.htm",
			   dataType:"json",
			   data:{"date":date},
			   success:function (data) {
				$("#todayCount").text(data.result);
				getTodaySum(date);
				},
				error:function () {
	                  layer.msg("查询出错");
	            }
				
			});
		}
		
		//获取当天总销售额
		function getTodaySum(date){
			
			$.ajax({
				url:"/moviesMaven/order/getTodaySum.htm",
			   dataType:"json",
			   data:{"date":date},
			   success:function (data) {
				$("#todaySum").text(data.result);
				
				},
				error:function () {
	                  layer.msg("查询出错");
	            }
				
			});
		}

		
	
	
 	</script>
 	

</body>
</html>